#ifndef OBSERVE_SUBJECT_H
#define OBSERVE_SUBJECT_H

#include <list>
#include <string>
#include <iostream>

using namespace std;
typedef string State;

class ObserveM;
class ObserveSubject
{
public:
    virtual ~ObserveSubject();

    virtual void attatch(ObserveM *obv);
    virtual void detatch(ObserveM *obv);
    virtual void notify();

    virtual State GetState() = 0;
protected:
    ObserveSubject();

private:
    list<ObserveM*>* _obvl;
};

class ConcreteObvSubject : public ObserveSubject
{
public:
    ConcreteObvSubject();
    ~ConcreteObvSubject();

    virtual State GetState();
    void SetState(const State& st);

private:
    State _st;
};

#endif // OBSERVE_SUBJECT_H
